<?php
namespace Admin\Controller;
// use Think\Controller;
header("Content-type: text/html; charset=utf-8");
use Admin\Common\CommonController;
class TongjiController extends CommonController{
	//列出统计图形
    public function listAction(){
    	
    	$this->display();
    }

    public function ajaxAction(){
    	$sql="select count(*) num,DATE_FORMAT(regist_time,'%Y-%m-%d') date from user where unix_timestamp(regist_time)<=(select max(unix_timestamp(regist_time)) from user) and unix_timestamp(regist_time)>=(select max(unix_timestamp(regist_time)-24*60*60*7) from user) group by DATE_FORMAT(regist_time,'%Y-%m-%d')";
    	$data_m=M();
    	$res=$data_m->query($sql);
    	// var_dump($res);
    	echo json_encode($res);
    }

}